﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using GameSchool.Models;

namespace GameSchool.Controllers
{
	public class HomeController : Controller
	{
        private IGameSchoolRepository m_rep = null;

        public HomeController()
        {
            m_rep = new GameSchoolRepository();
        }

        public HomeController(IGameSchoolRepository rep)
        {
            m_rep = rep;
        }

		public ActionResult Index()
		{
            /*var model = (from item in m_rep.Achievements()
                         orderby item.achievementID descending
                         select item).Take(10);

            using (var db = new GameSchoolContext())
            {
         //       Teacher foo = new Teacher(); // just trying out if we can create a teacher and if he has the right member variables... -eiki
               //   foo.email = "snap@snapattack.com";
         //         var item = db.teachers.Add(foo);
                    return View(db.lectures.ToList());
             }
             */

            return Redirect("~/Account/LogOn");
		}

		public ActionResult About()
		{
			return View();
		}

        public ActionResult Assignments()
        {   //mucking about with putting information into the viewmodel and shipping it off to the Assignments.cshtml view
            StudentPartialViewModel model = new StudentPartialViewModel();
            Assignment ass = new Assignment();
            ass.description = "description of the assignment";
            List<Assignment> assList = new List<Assignment>();
            assList.Add(ass); //most beautiful piece of code ever written
            model.assignments = assList;
            return View(model);
        }

        public ActionResult OnlineExams()
        {
            return View();
        }

        public ActionResult Lectures()
        {
            return View();
        }

        public ActionResult Description()
        {
            return View();
        }

        public ActionResult XPAchievements()
        {
            return View();
        }

	}
}
